<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('活动签到列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <p>用户：</p>
                                <input th:value="${user.nickname}" disabled=disabled/>
                                <input type="hidden" name="activityId" th:value="${activityId}"/>
                                <input type="hidden" name="kkid" th:value="${kkid}"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="yingyu:activitycheckin:export">
                    <i class="fa fa-download"></i> 导出
                 </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('yingyu:activitycheckin:edit')}]];
        var removeFlag = [[${@permission.hasPermi('yingyu:activitycheckin:remove')}]];
        var modeDatas = [[${@dict.getType('yingyu_reg_mode')}]];
        var prefix = ctx + "yingyu/activitycheckin";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "活动签到",
                columns: [{
                    checkbox: true
                },
                {
                    field : 'id', 
                    title : 'id',
                    visible: false
                },
                {
                    field : 'activityId', 
                    title : '活动ID'
                },
                {
                    field : 'kkid', 
                    title : 'kkid'
                },
                {
                    field : 'date', 
                    title : '日期'
                },
                {
                    field : 'mode', 
                    title : '模式',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(modeDatas, value);
                    }
                },
                {
                    field : 'yuan', 
                    title : '挣得的返利'
                },
                {
                    field : 'createdTime', 
                    title : '签到时间'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>